// 1.一个字符串，首尾相连，计算出现偶数个o的字符串最长的长度
// 华为德科机试@七号大米
// https://blog.csdn.net/qq_40963630/article/details/114401038 alolobo 输出：6
// looxdolx
// 输出：7
// bcbcbc
// 输出：6
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
// 通过率100%
public
class Main {
 public
  static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String temp;
    while ((temp = br.readLine()) != null) {
      int length = temp.length();
      int sum = 0;
      for (int i = 0; i < length; i++) {
        if (temp.charAt(i) == 'o') {
          sum++;
        }
      }
      if (sum % 2 == 0) {
        System.out.println(temp.length());
      } else {
        System.out.println(temp.length() - 1);
      }
    }
  }
}